package com.gator.desig_mode.visitor;

import java.util.LinkedList;
import java.util.List;

/**
 * @author 何章怀晓 hezhanghuaixiao
 * @version V1.0
 * @desc 被访问者管理者
 */
public class ObjectElement {

  private List<Persion> list = new LinkedList<>();


  public void add(Persion persion) {
    list.add(persion);
  }


  public void rem(Persion persion) {
    list.remove(persion);
  }

  //显示评价
  public void display(Action action) {
    for (Persion p : list
    ) {
      //调用被访问者
      p.accpte(action);
    }
  }


}
